package com.bdqn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.SysUser;
import com.bdqn.service.SysUserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * SysUserServiceImpl
 *
 * @author LILIBO
 * @since 2025/3/19
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Resource
    private SysUserMapper sysUserMapper;

    /**
     * 根据姓名和角色ID查找用户列表（自定义接口）
     *
     * @param usrName
     * @param usrRoleId
     * @return
     */
    @Override
    public List<SysUser> getByUsrNameAndRoleId(String usrName, Long usrRoleId) {
        return sysUserMapper.getByUsrNameAndRoleId(usrName, usrRoleId);
    }

    /**
     * 根据姓名和密码查找用户信息（自定义接口）
     *
     * @param usrName
     * @param usrPassword
     * @return
     */
    @Override
    public SysUser getByUsrNameAndUsrPassword(String usrName, String usrPassword) {
        return sysUserMapper.getByUsrNameAndUsrPassword(usrName, usrPassword);
    }

}
